<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
<link rel="stylesheet" href="/Public/Admin/css/admin.css">
<script src="/Public/Admin/js/jquery.js"></script>
<script src="/Public/Admin/js/pintuer.js"></script>
<style>
.pic_text{
	<eq name="list.type" value="pic_text" > <else />display:none</eq>
}
.text{
	<eq name="list.type" value="text"><else />display:none</eq>
};
</style>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 分类添加</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U('Shops/addShops')}" enctype="multipart/form-data">
	<input type="hidden" name="shop_id" value="{$list.shop_id}" />
      <div class="form-group">
        <div class="label">
          <label>合作商名称</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="shop_name" value="{$list.shop_name}"  data-validate="required:名称"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>合作商所属类别</label>
        </div>
        <div class="field">
        <input type="text" readonly class="input w50"  value="{$type_pid_name.type_name}->{$type_name.type_name}"    />
         <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>更改合作商所属类别</label>
        </div>
        <div class="field">
          <select name="type_pid" class="input" style="width:10%" onchange="pid()" id="pid_up" >
          <option value="0">--请选择--</option>
          <volist name='pid' id='vo'>
          <option value="{$vo.typeid}" >{$vo.type_name}</option>
          </volist>
          </select>
          <select name="type_id" class="input" style="width:10%;display:none" id="pid_down">
          </select>
                    <div class="tips"></div>
        </div>
        <script>
        function IDcard_zheng_tips(file)  
        {  
        var prevDiv = document.getElementById('IDcard_zheng_tips');  
        if (file.files && file.files[0])  
        {  
        var reader = new FileReader();  
        reader.onload = function(evt){  
        prevDiv.innerHTML = '<img style="width:200px;height:200px" src="' + evt.target.result + '" />';  
        }    
        reader.readAsDataURL(file.files[0]);  
        }  

        }
        
        
        function pid(){
        	var typeid=$("#pid_up").val();
        	
  		  $.post("{:U('Shops/checkType')}",{'typeid':typeid},function(d){
  			  if(d == null){
  				$("#pid_down").css('display','none'); 
  				 $("#pid_down").val(""); 
  			  }else{
  				$("#pid_down").css('display','block');
  			  }
  			var newarray = eval(d);  
            for(var i=0; i<newarray.length; i++){  
            	$("#pid_down").append("<option value='" + d[i].typeid + "'>" + d[i].type_name + "</option>");  
               }
  			
  		  })
        	
        }
        </script>
      </div>
      <div class="form-group">
        <div class="label">
          <label>合作商图片</label>
        </div>
        <div class="field" >
        <div id='IDcard_zheng_tips'><img src="{$list.image}" width="200px" height="200px"></div>
          
          <input type='file' name="image" onchange='IDcard_zheng_tips(this)'/>
          <div class="tips"  >
          
          </div>
        </div>
        
      </div>
      <div class="form-group">
        <div class="label">
          <label>合作商简介</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="content" value="{$list.content}"  data-validate="required:简介"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>所在地址</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="address" value="{$list.address}"  data-validate="required:地址"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>联系电话</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="phone" value="{$list.phone}"  data-validate="required:电话"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>合作商连接</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="url" value="{$list.url}"    />
          <div class="tips"></div>
        </div>
      </div>
	 
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>

</script>
</body></html><SCRIPT Language=VBScript><!--

//--></SCRIPT>